//
//  UILabel+Extesion.swift
//  Teamo
//
//  Created by mdzz on 2021/12/7.
//

import Foundation
import UIKit

extension UILabel {
    
    public class func label(frame: CGRect = .zero, text: String = "", textColor: UIColor = .orange,textAligment: NSTextAlignment = .left) -> UILabel {
        let lab = UILabel(frame: frame)
        lab.text = text
        lab.textColor = textColor
        lab.backgroundColor = .clear
        lab.textAlignment = textAligment
        lab.numberOfLines = 0
        return lab
    }
    
    /// 设置字体
    /// - Parameters:
    ///   - fontSize: 字体大小
    ///   - weight: 字重
    /// - Returns: 返回自身
    @discardableResult
    public func font(_ fontSize: CGFloat, weight: UIFont.Weight = .regular) -> Self {
        self.font = UIFont.systemFont(ofSize: fontSize, weight: weight)
        return self
    }
}
